home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 273_01 / getldate.cc < prev    next >
Text File  |  1988-04-17  |  1KB  |  31 lines

  1. #include <dos.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. long int get_long_date()
  6. /*
  7. ┌────────────────────────────────────────────────────────────────────┐
  8. │Purpose: Get the current date.                                      │
  9. │                                                                    │
  10. │ Inputs: None.                                                      │
  11. │                                                                    │
  12. │Outputs: None.                                                      │
  13. │                                                                    │
  14. │ Return: A long int containing the current date in the format       │
  15. │         YYMMDD.                                                    │
  16. └────────────────────────────────────────────────────────────────────┘
  17. */
  18. {
  19.  
  20. struct date today;
  21. char mystr[40];
  22. long l_date;
  23.  
  24.     getdate(&today);
  25.     sprintf(mystr,"%2.2d%2.2d%2.2d",
  26.         today.da_year - 1900,today.da_mon,today.da_day);
  27.  
  28.     l_date = atol(mystr);
  29.     return(l_date);
  30. }
  31.